package com.hns.can.service.web;

import com.hns.can.common.web.BaseController;
import com.hns.can.service.entity.BaseDrvChkParamInfoEntity;
import com.hns.can.service.service.AbnEmotionScoreService;
import com.hns.can.service.vo.AbnEmotionScoreVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * 情绪异常评分标准配置Controller
 * @author:zhangzq
 * @email:
 * @version Revision 2.0.0
 */
@Controller
@RequestMapping("/abnEmotionScore")
public class AbnEmotionScoreController extends BaseController {

    @Autowired
    private AbnEmotionScoreService abnEmotionScoreService;

    /**
     * @param corpId
     * @param organId
     * @throws Exception
     * @author:JeffXu
     * @email:835264047@qq.com
     * @创建日期:2014-11-12
     * @功能说明：情绪异常评分标准配置 - 查询情绪异常评分标准配置信息(该机构下没有相应配置就取默认的)
     */
    @RequestMapping("/searchAbnEmotionScoreInfo")
    @ResponseBody
    public Object searchAbnEmotionScoreInfo(String corpId, String organId) throws Exception {
        Map<String, Object> paraMap = new HashMap<String, Object>();
        paraMap.put("organId", organId);
        paraMap.put("corpId", corpId);
        paraMap.put("qchkCgyCodes", new String[]{"CHK02000"});
        List<BaseDrvChkParamInfoEntity> list = abnEmotionScoreService.searchAbnEmotionScoreInfo(paraMap);
        return this.getReturnResult(list);
    }

    /**
     * @param data
     * @throws Exception
     * @author:JeffXu
     * @email:835264047@qq.com
     * @创建日期:2014-11-12
     * @功能说明：情绪异常评分标准配置 - 修改情绪异常评分标准配置信息
     */
    @RequestMapping("/uptAbnEmotionScoreInfo")
    @ResponseBody
    public Object uptAbnEmotionScoreInfo(AbnEmotionScoreVo data) throws Exception {
        abnEmotionScoreService.uptAbnEmotionScoreInfo(data);
        return this.getReturnMsg("您成功修改该机构的情绪异常评分标准配置信息。");
    }
}
